<template>
  <el-dialog :title="'caption'" :visible.sync="visible"
             :close-on-click-modal="false">
    <el-table :data="sheet.rows" highlight-current-row v-loading="sheet.loading" stripe="stripe" border="border"
              @sort-change="sortChange" style="width: 100%;" max-height="690" :row-style="tableRowStyle">
      <el-table-column prop="id" label="序号" width="80" sortable="sortable" :show-overflow-tooltip="true"
                       header-align="center"/>
      <el-table-column prop="coin" label="币种" min-width="150" sortable="sortable" :show-overflow-tooltip="true"
                       header-align="center"/>
      <el-table-column prop="balance" label="可用余额" min-width="150" sortable="sortable" :show-overflow-tooltip="true"
                       header-align="center"/>
      <el-table-column prop="frozenBalance" label="冻结余额" min-width="150" sortable="sortable"
                       :show-overflow-tooltip="true" header-align="center"/>
    </el-table>

  </el-dialog>
</template>
<script>
  let data = () => {
    return {
      visible: false,
      sheet: {
        rows: [],
        total: 0,
        pageNum: 1,
        pageSize: 20,
        sort: 'createTime',
        loading: false
      },
    }
  }
  let getList = function (url, param) {
    this.sheet.loading = true
    this.$http.post(url, param).then(res => {
      let response = res.data.data;
      this.sheet.total = response.total
      this.sheet.rows = response.content
      this.sheet.loading = false
    }).catch(() => this.sheet.loading = false)
  }

  export default {
    data: data,
    props: ['caption'],
    methods: {
      show: function (url, param) {

      },
      getList,
    },
    name: "tableDialog"
  }
</script>

<style scoped>

</style>
